package com.sanery.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sanery.dao.AddAgreenDaoImpl;

@WebServlet(urlPatterns = { "/addAgree" })
public class AddAgreeServlet extends HttpServlet {

	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		try {
			Integer id = Integer.valueOf(request.getParameter("opinoin_id"));
			System.out.println(id);
			AddAgreenDaoImpl dao = new AddAgreenDaoImpl();
			dao.addAgreen(id);
			response.sendRedirect("list");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		doGet(request, response);
	}

}
